package com.yxw.springmvc.test.batch;

import org.springframework.batch.item.ItemProcessor;

/**
 * Created by hp on 2016/10/17.
 */
public class PersonItemProcessor implements ItemProcessor<Person,Person>{

    @Override
    public Person process(Person person) throws Exception {
        final String firstName = person.getFirstName().toUpperCase();
        final String lastName = person.getLastName().toUpperCase();
        final Person transformedPerson = new Person(firstName, lastName);
        System.out.println("Converting (" + person + ") into ("
                + transformedPerson + ")");
        return transformedPerson;
    }
}
